import request from '@/utils/request'
import http from '@/utils/request'

export function getRoutes() {
  return request({
    url: '/vue-element-admin/routes',
    method: 'get'
  })
}

export function getRoles() {
  return request({
    url: '/vue-element-admin/roles',
    method: 'get'
  })
}

export function updateRole(id, data) {
  return request({
    url: `/vue-element-admin/role/${id}`,
    method: 'put',
    data
  })
}

export async function getAllRoles(params) {
  return await http.post("/api/getAllRoles",params)
}

export async function deleteRole(params) {
  return await http.post("/api/deleteRole",params)
}

export async function getRoleByRoleName(params) {
  return await http.post("/api/getRoleByRoleName",params)
}


export async function addRole(params) {
  return await http.post("/api/addRole",params)
}


export async function selectRoleDeatil(params) {
  return await http.post("/api/selectRoleDeatil",params)
}

export async function editRole(params) {
  return await http.post("/api/editRole",params)
}
